package eliauk.fun.flowabledemo.listener.government.countersign;

import eliauk.fun.flowabledemo.FlowableConstant;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;


@Slf4j
@Component("CountersignAllListener")
public class CountersignAllListener implements ExecutionListener {
    @Override
    public void notify(DelegateExecution delegateExecution) {
        String checkResult = (String) delegateExecution.getVariable(FlowableConstant.CHECK_RESULT);
        if (checkResult != null) {
            switch (checkResult) {
                case FlowableConstant.PASS:
                    log.info("所有审批都通过,会签结束");
                    break;
                case FlowableConstant.FAIL:
                    log.info("有一个审批不通过,会签结束");
            }
        }
    }
}
